package com.platform.api.dao;

import com.platform.api.entity.CartVo;
import com.platform.common.dao.BaseDao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author lipengjun
 * @email 939961241@qq.com
 * @gitee https://gitee.com/fuyang_lipengjun/platform
 * @date 2017-08-11 09:14:25
 */
@Mapper
@Repository
public interface ApiCartMapper{// extends BaseDao<CartVo> {
    int save(CartVo t);
    void save(Map<String, Object> map);
//    void saveBatch(List<T> list);
    int update(CartVo t);
    int update(Map<String, Object> map);
    int delete(Object id);
    int delete(Map<String, Object> map);
    int deleteBatch(Object[] id);
    CartVo queryObject(Object id);
    List<CartVo> queryList(Map<String, Object> map);
    List<CartVo> queryList(Object id);
    int queryTotal(Map<String, Object> map);
    int queryTotal();
    void updateCheck(@Param("productIds") String[] productIds,
                     @Param("isChecked") Integer isChecked, @Param("userId") Long userId);

    void deleteByProductIds(@Param("productIds") String[] productIds);

    void deleteByUserAndProductIds(@Param("user_id") Long user_id, @Param("productIds") String[] productIds);

    void deleteByCart(@Param("user_id") Long user_id, @Param("session_id") Integer session_id, @Param("checked") Integer checked);
}
